package com.kx.mybatis.mapper;

import com.kx.mybatis.pojo.MemberUser;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description
 * @ClassName UserMapper
 * @Author Sun
 * @Date 2021/5/15 17:39
 * @Version 1.0
 */
public interface UserMapper {

    @Select("select * from member_user where id=#{id}")
    MemberUser getUserById(Long id);

    @Select("select * from member_user")
    List<MemberUser> selectUsers();

    @Insert("INSERT INTO Member_User (Name,Nickname,Password,PasswordSalt,PayPassowrdSalt) VALUES(#{name},#{nickname},#{password},#{passwordSalt},#{payPassowrdSalt})")
    void insertUser(MemberUser user);
}
